<template>
  <div id="app">
    <button @click="switchLang">{{$t('message')}}</button>
    <span class="material-icons">search</span>
    <router-view/>
  </div>
</template>

<script>
  export default {
    methods: {
      switchLang() {
        if (this.$i18n.locale === 'zh') {
          this.$i18n.locale = 'en'
        } else {
          this.$i18n.locale = 'zh'
        }
      }
    }
  }
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
</style>
